@extends('layout.layout');

@section('title','用户修改');

@section('content')
<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span>用户修改</span>
    </div>


    <div class="mws-panel-body no-padding">
    	<form class="mws-form" action="/user/{{$user['id']}}" method="post" enctype="multipart/form-data">
	    	@if (count($errors) > 0)
			    <div class="mws-form-message error">
					出错啦!!
		            <ul>
		            	@foreach ($errors->all() as $error)
			                <li>{{ $error }}</li>
			            @endforeach
		                
		            </ul>
		        </div>
			@endif

    		<div class="mws-form-inline">
    			<div class="mws-form-row">
    				<label class="mws-form-label">用户名</label>
    				<div class="mws-form-item">
    					<input type="text" class="small" value="{{$user['username']}}" name="username">
    				</div>
    			</div>
    			

    			<div class="mws-form-row">
    				<label class="mws-form-label">邮箱</label>
    				<div class="mws-form-item">
    					<input type="text" class="small" value="{{$user['email']}}" name="email">
    				</div>
    			</div>
    			
    			<div class="mws-form-row">
    				<label class="mws-form-label">头像</label>
                    <div class="mws-form-item">
                        <img src="{{$user['img']}}" style="width:100px" alt="">
                    </div>
    				<div class="mws-form-item">
    					<input type="file" class="small" value="{{$user['img']}}" name="img">
    				</div>
    			</div>
    		</div>
    		{{csrf_field()}}
    		<div class="mws-button-row">
                <input type="hidden" name="_method" value="PUT">
    			<input type="submit" value="修改" class="btn btn-danger">
    			<input type="reset" value="重置" class="btn ">
    		</div>
    	</form>
    </div>    	
</div>
@endsection('content');